
const path = require('path')
const {VueLoaderPlugin} = require('vue-loader')
const htmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
    mode:'development',
    entry: {
        index:'./src/index.js'
    },
    output: {
        filename: "[name].bundle.js",
        path: path.resolve(__dirname,'dist'),
        clean:true
    },
    devServer: {
        static:'./dist'
    },
    plugins: [
        new htmlWebpackPlugin({}),
        new VueLoaderPlugin()
    ],
    devtool: 'inline-source-map',
    module: {
       rules:[{
           test:/\.css$/i,
           use:['vue-style-loader','css-loader']
       },{
           test:/\.(png|jpg|jpeg|gif)$/i,
           type:'asset/resource'
       },{
           test:/\.(woff|woff2|eot|ttf|otfc)$/i,
           type:'asset/resource'
       },{
           test:/\.vue$/i,
           loader: 'vue-loader'
       },{
           test:/\.js$/i,
           exclude: /(node_modules|bower_components)/,
           loader: 'babel-loader'
       }]
    }
}